<!-- login.html -->
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录窗口</title>
    <link rel="stylesheet" href="{{url_for('static',filename='login.css')}}">
</head>
<body>
    <div class="login-container">
        <h2 id="formTitle">登录</h2>
        <form id="loginForm" action="/login" method="post">
            <input type="text" id="username" name="username" placeholder="用户名" required>
            <input type="password" id="password" name="password" placeholder="密码" required>
            <input type="radio" name="user_type" value="student"><label for="student">学生</label>
            <input type="radio" name="user_type" value="teacher"><label for="teacher">教师</label><br>
            <button type="submit">登录</button>
        </form>
        <form id="registerForm" action="/register" method="post" style="display:none;">
            <input type="text" id="regUsername" name="username" placeholder="用户名" required>
            <input type="password" id="regPassword" name="password" placeholder="密码" required>
            <input type="radio" name="user_type" value="student"><label for="student">学生</label>
            <input type="radio" name="user_type" value="teacher"><label for="teacher">教师</label><br>
            <button type="submit">注册</button>
        </form>
        <div id="messageContainer" style="display:none;">
            <iframe id="messageIframe" name="messageIframe" style="width:100%; height:50px;"></iframe>
        </div>
        <p>还没有账号？ <a href="javascript:void(0);" onclick="toggleForm()">点击这里注册</a></p>
    </div>
    <script src="{{url_for('static',filename='login.js')}}"></script>
</body>
</html>
